package com.inspur.resourcequery.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.inspur.resourcequery.ResDetailActivity;
import com.inspur.resourcequery.fragment.ResDetailFragment;
import com.inspur.resourcequery.fragment.ResRelationFragment;

public class ResDetailPagerAdapter extends FragmentPagerAdapter {
	public final static int TAB_INDEX_TAB_1 = 0;
	public final static int TAB_INDEX_TAB_2 = 1;
	public final static int TAB_COUNT = 2;

	public ResDetailPagerAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int pos) {
		// TODO Auto-generated method stub
		switch (pos) {
		case TAB_INDEX_TAB_1:
			return new ResDetailFragment();

		case TAB_INDEX_TAB_2:
			return new ResRelationFragment();
		}

		throw new IllegalStateException("No fragment at position " + pos);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return TAB_COUNT;
	}
}
